CoLinuxGentooPart1
Category:Gentoo *Purpose*: This guide details the 1st Part of steps that one has to follow in order to successfully install Gentoo Linux 2004.1 from scratch. *Description*: By following this guide one will end up with a Gentoo 2004.1 stage3 system that can be used with coLinux. Please, review the requirements below before proceeding. This guide only follows the [[GentooHandbookInstallationGuide]]. Emerging other packages than the ones mentioned here is beyond the scope of this guide. The Gentoo 2004.1 system will be installed over this filesystem disk hierarchy: swap - 0.swap_fs-256MB - 256MB /boot - 1.boot_fs-64MB.ext2 - 64 MB /root - 2.root_fs-1GB.ext2 - 1 GB /usr - 3.usr_fs-2GB.ext2 - 2 GB /var - 4.var_fs-1GB.ext2 - 1 GB Note: all filesystem disks will be formatted as ext2. Other filesystem types are beyond the scope of this guide. *Requirements*: * Linux Rescue Disk. I recommend using Mandrake 10.0 Linux Rescue Disk. For other Rescue Disks, please review the LinuxRescueDisks page. * coLinux 0.6.1. * gentoo.colinux.xml. Please, review my example at UserConfigs. Bare in mind that I keep all filesystem disk files inside a sub-folder of co Linux. The Rescue Disk will be /dev/cobd5, until the Gentoo 2004.1 system is ready to be launched by coLinux. * Gentoo 2004.1 Universal Live-CD. *Optional*: * WinPcap 3.0 beta. I prefer to use Bridge Networking instead of TAP Networking, mainly because network routing between coLinux and the Windows Host is more transparent. With DHCP configuration, coLinux with Gentoo 2004.1 was networked and ready to access the Internet as soon as I finished following the steps that are detailed in this guide. There's one caveat, though, which is using IP names between co Linux and Windows. So far, I have to use the IP number of coLinux DHCP and Windows DHCP in order to connect both, for instance when using ssh or ftp. * Cygwin. I recommend using Cygwin, which is most useful for remote login sessions. I also used it to compile coLinux-file-utils.tar.gz in order to obtain the binaries mkFile.exe, mkSparse.exe and spSize.exe. Of these, mk File is most useful and fast in creating blank filesystem disk files. Using mkFile, create 1.boot_fs-64MB.ext2, 2.root_fs-1GB.ext2, 3.usr_fs-2GB.ext2 and 4.var_fs-1GB.ext2 files, which will be used later to hold the Gentoo 2004.1 system. * Filesystem Disk Files. Instead of using Cygwin and mkFile, one can download blank filesystem disk files from here. ---- *Note*: I assume you're using gentoo.colinux.xml Configuration File and Mandrake 10.0 Rescue Disk. Since I work with a Portuguese keyboard, before starting one has to issue loadkeys pt to change keyboard layouts, after picking menu option Go To Console. To ease future mounting commands, after restarting coLinux, issue: echo /dev/cobd2 /mnt/gentoo ext2 defaults 0 0 >> /etc/fstab echo /dev/cobd1 /mnt/gentoo/boot ext2 defaults 0 0 >> /etc/fstab echo /dev/cobd3 /mnt/gentoo/usr ext2 defaults 0 0 >> /etc/fstab echo /dev/cobd4 /mnt/gentoo/var ext2 defaults 0 0 >> /etc/fstab echo /dev/cobd7 /mnt/cdrom auto defaults,ro 0 0 >> /etc/fstab To Activate the Swap Partition, issue: mkswap /dev/cobd0 swapon /dev/cobd0 To format each filesystem disk file, issue: mke2fs / mkfs.ext2 /dev/cobd1 -L bootDisk mke2fs / mkfs.ext2 /dev/cobd2 -L rootDisk mke2fs / mkfs.ext2 /dev/cobd3 -L usrDisk mke2fs / mkfs.ext2 /dev/cobd4 -L varDisk To mount each filesystem disk file, issue: mkdir /mnt/gentoo mount /dev/cobd2 /mnt/gentoo mkdir /mnt/gentoo/boot mkdir /mnt/gentoo/usr mkdir /mnt/gentoo/var mount /dev/cobd1 /mnt/gentoo/boot mount /dev/cobd3 /mnt/gentoo/usr mount /dev/cobd4 /mnt/gentoo/var mount /dev/cobd7 /mnt/cdrom To setup Gentoo Stage3, issue: tar -jxpf /mnt/cdrom/stages/gentoo-2004.1/stage3-i686-2004.1.tar.bz2 -C /mnt/gentoo tar -jxf /mnt/cdrom/snapshots/gentoo-2004.1/portage-20040413.tar.bz2 -C /mnt/gentoo/usr cp -R /mnt/cdrom/distfiles/ /mnt/gentoo/usr/portage/distfiles/ Now, it's time to change root to Gentoo, so issue: chroot /mnt/gentoo /bin/bash env-update; source /etc/profile To prepare Gentoo for coLinux, issue: for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 do mknod /dev/cobd$i b 117 $i done Don't forget to change root's password, by issuing: passwd Add users, by issuing: useradd -m -G users,wheel,audio -s /bin/bash passwd Now, proceed with regular Gentoo instalation steps: ln -sf /usr/share/zoneinfo/Europe/Lisbon /etc/localtime echo colinux > /etc/hostname echo gentoo.org.lan > /etc/dnsdomainname rc-update add domainname default rc-update add sshd default Note: I use Lisbon timezone as the local time, please change it accordingly to your timezone. Then, edit /etc/fstab, /etc/conf.d/net and /etc/rc.conf. Now, issue: rc-update add net.eth0 default Before restarting coLinux, edit the gentoo.colinux.xml to change root=/dev/cobd5 with root=/dev/cobd2. This causes the kernel to boot root from /dev/cobd2 instead of the /dev/cobd5 which is the Rescue Disk. And you should now have a working and clean Stage 3 Gentoo Linux 2004.1 system under coLinux. ---- The matching fstab for the gentoo.colinux.xml that I use is: # ############################################################################### #-----------------------------------------------------------------------------# # Company: ~DoWeDo-IT # # Project: coLinux with Gentoo # # Filename: fstab # # Author: José Carlos Monteiro # # ~mailto:Jose.Monteiro@~DoWeDo-IT.com Mob: +351.91.776.5726 # #-----------------------------------------------------------------------------# # Description: This script holds the statis file system information. # # # # Usage: # # # # Parameters: # # # # To-Do: # # # #-----------------------------------------------------------------------------# # History: # # VS DATE AUTHOR SUMMARY # # 0.01 14/Jul/2004 José Carlos Monteiro Initial source coding. # # # #-----------------------------------------------------------------------------# ############################################################################### # ############################################################################### # /etc/fstab: static file system information. # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $ #-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------# # noatime turns off atimes for increased performance (atimes normally aren't # needed; notail increases performance of ReiserFS (at the expense of storage # efficiency). It's safe to drop the noatime options if you want and to # switch between notail and tail freely. #-----------------------------------------------------------------------------# # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts. # /dev/cobd0 none swap sw 0 0 /dev/cobd2 / ext2 defaults,noatime 1 1 /dev/cobd1 /boot ext2 defaults,noatime 1 0 /dev/cobd3 /usr ext2 defaults,noatime 1 0 /dev/cobd4 /var ext2 defaults,noatime 1 0 /dev/cobd6 /mnt/fdd auto noauto 0 0 /dev/cobd7 /mnt/cdd0 iso9660 noauto,user,ro 0 0 #/dev/cobd8 /mnt/cdd1 iso9660 noauto,user,ro 0 0 #/dev/fd0 /mnt/floppy auto noauto 0 0 #/dev/cdroms/cdrom0 /mnt/cdd0 iso9660 noauto,user,ro 0 0 #/dev/cdroms/cdrom1 /mnt/cdd1 iso9660 noauto,user,ro 0 0 #-----------------------------------------------------------------------------# # NOTE: The next line is critical for boot! none /proc proc defaults 0 0 #-----------------------------------------------------------------------------# # glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for # POSIX shared memory (shm_open, shm_unlink). # (tmpfs is a dynamically expandable/shrinkable ramdisk, and will # use almost no memory if not populated with files) # Adding the following line to /etc/fstab should take care of this: none /dev/shm tmpfs defaults 0 0 An example of /etc/conf.d/net is: # ############################################################################### #-----------------------------------------------------------------------------# # Company: ~DoWeDo-IT # # Project: coLinux with Gentoo # # Filename: net # # Author: José Carlos Monteiro # # ~mailto:Jose.Monteiro@~DoWeDo-IT.com Mob: +351.91.776.5726 # #-----------------------------------------------------------------------------# # Description: This script sets Global Network Configuration settings. # # # # Usage: # # # # Parameters: # # # # To-Do: # # # #-----------------------------------------------------------------------------# # History: # # VS DATE AUTHOR SUMMARY # # 0.01 14/Jul/2004 José Carlos Monteiro Initial source coding. # # # #-----------------------------------------------------------------------------# ############################################################################### # ############################################################################### # /etc/conf.d/net: # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $ # Global config file for net.* rc-scripts #-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------# # Static IP Configuration # ----------------------- # iface_eth0="192.168.0.100 broadcast 192.168.0.255 netmask 255.255.255.0" # iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0" #-----------------------------------------------------------------------------# # DHCP Configuration # ------------------ # For DHCP set iface_eth? to "dhcp" # For passing options to dhcpcd use dhcpcd_eth? iface_eth0="dhcp" #dhcpcd_eth0="..." #-----------------------------------------------------------------------------# # Interface Aliases # ----------------- # alias_eth0="192.168.0.3 192.168.0.4" #-----------------------------------------------------------------------------# # NB: The next is only used for aliases. # To add a custom netmask/broadcast address uncomment and change accordingly. # Leave commented to assign defaults for that interface. #broadcast_eth0="192.168.0.255 192.168.0.255" #netmask_eth0="255.255.255.0 255.255.255.0" #-----------------------------------------------------------------------------# # Default Gateway Settings # ------------------------ # gateway="eth0/192.168.0.1" # gateway="eth0/192.168.0.254" ---- An example of /etc/rc.conf is: # ############################################################################### #-----------------------------------------------------------------------------# # Company: ~DoWeDo-IT # # Project: coLinux with Gentoo # # Filename: rc.conf # # Author: José Carlos Monteiro # # ~mailto:Jose.Monteiro@~DoWeDo-IT.com Mob: +351.91.776.5726 # #-----------------------------------------------------------------------------# # Description: This script sets global startup configuration settings. # # # # Usage: # # # # Parameters: # # # # To-Do: # # # #-----------------------------------------------------------------------------# # History: # # VS DATE AUTHOR SUMMARY # # 0.01 14/Jul/2004 José Carlos Monteiro Initial source coding. # # # #-----------------------------------------------------------------------------# ############################################################################### # ############################################################################### # /etc/rc.conf: Global startup script configuration settings # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/rc.conf,v 1.22 2003/10/21 06:09:42 vapier Exp $ #-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------# # Use KEYMAP to specify the default console keymap. There is a complete tree # of keymaps in /usr/share/keymaps to choose from. This setting is used by the # /etc/init.d/keymaps script. KEYMAP="pt-latin9" #-----------------------------------------------------------------------------# # Should we first load the 'windowkeys' console keymap? Most x86 users will # say "yes" here. Note that non-x86 users should leave it as "no". SET_WINDOWKEYS="yes" #-----------------------------------------------------------------------------# # The maps to load for extended keyboards. Most users will leave this as is. EXTENDED_KEYMAPS="backspace keypad" #-----------------------------------------------------------------------------# # CONSOLEFONT specifies the default font that you'd like Linux to use on the # console. You can find a good selection of fonts in /usr/share/consolefonts; # you shouldn't specify the trailing ".psf.gz", just the font name below. # To use the default console font, comment out the CONSOLEFONT setting below. # This setting is used by the /etc/init.d/consolefont script (NOTE: if you do # not want to use it, run "rc-update del consolefont" as root). CONSOLEFONT="default8x16" #-----------------------------------------------------------------------------# # CONSOLETRANSALTION is the charset map file to use. Leave commented to use # the default one. Have a look in /usr/share/consoletrans for a selection of # map files you can use. #CONSOLETRANSLATION="8859-1_to_uni" #-----------------------------------------------------------------------------# # Set CLOCK to "UTC" if your system clock is set to UTC (also known as # Greenwich Mean Time). If your clock is set to the local time, then set CLOCK # to "local". This setting is used by the /etc/init.d/clock script. CLOCK="UTC" #-----------------------------------------------------------------------------# # Set EDITOR to your preferred editor. EDITOR="/bin/nano" #EDITOR="/usr/bin/vim" #EDITOR="/usr/bin/emacs" #-----------------------------------------------------------------------------# # Set PROTOCOLS to the protocols that you plan to use. Gentoo Linux will only # enable module auto-loading for these protocols, eliminating annoying module # not found errors. # # NOTE: Do NOT uncomment the next lines, but add them to 'PROTOCOLS=...' line!! # # Num Protocol # 1: Unix # 2: IPv4 # 3: Amateur Radio AX.25 # 4: IPX # 5: DDP / appletalk # 6: Amateur Radio NET/ROM # 9: X.25 # 10: IPv6 # 11: ROSE / Amateur Radio X.25 PLP # 19: Acorn Econet # Most users want this: PROTOCOLS="1 2" #For IPv6 support: #PROTOCOLS="1 2 10" #-----------------------------------------------------------------------------# # What display manager do you use ? ~[ xdm | gdm | kdm | entrance ] #DISPLAYMANAGER="xdm" #-----------------------------------------------------------------------------# # XSESSION is a new variable to control what window manager to start # default with X if run with xdm, startx or xinit. The default behavior # is to look in /etc/X11/Sessions/ and run the script in matching the # value that XSESSION is set to. The support scripts is smart enouth to # look in all bin directories if it cant find a match in /etc/X11/Sessions/, # so setting it to "enligtenment" can also work. This is basically used # as a way for the system admin to configure a default system wide WM, # allthough it will work if the user export XSESSION in his .bash_profile, etc. # # NOTE: 1) this behaviour is overridden when a ~/.xinitrc exists, and startx # is called. # 2) even if a ~/.xsession exist, if XSESSION can be resolved, it will # be executed rather than ~/.xsession, else KDM breaks ... # # Defaults depending on what you install currently include: # # Gnome - will start gnome-session # kde- - will start startkde (ex: kde-3.0.2) # Xsession - will start a terminal and a few other nice apps #XSESSION="Gnome" ----MassTranslated on 25 Dec 2004. ManuallyAdjusted on 25 Dec 2004. ----MassTranslated on Sun Apr 23 17:35:46 UTC 2006